<?php
class BlogAction extends BaseAction {

	public function _empty() {
		$this->display("Index:blog");
	}

	public function index() {
		$blogs = D("blog")->select();
		$this->assign('blogs', $blogs);
		
		
		$d_bc = D('BlogCategory')->select();
		$this->assign('d_bc', $d_bc);
		
		$this->display("Index:blog_list");
	}
	
	public function submit() {
		$data = $_POST;
		$data['cTime'] = time();
		D("blog")->add($data);
		$this->display("Index:blog");
	}

}
?>